﻿using System;
using System.Windows.Forms;
using Microsoft.Practices.Unity;
using Microsoft.Practices.ServiceLocation;
using PMngr.Data;

namespace PMngr.Main
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // services
            var repositoryFactory = new RepositoryFactory("SQLCE");
            IUnityContainer container = new UnityContainer().RegisterInstance<IRepositoryFactory>(repositoryFactory);
            // service locator
            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(container));

            Application.Run(container.Resolve<MainForm>());
        }
    }
}
